<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <link rel="SHORTCUT ICON" href="<?php echo Yii::app()->request->baseUrl; ?>/images/favicon.ico" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/dashboard.css" />
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>

    <body>

        <!--
            Setup the application theme and the main JavaScript controller.
        -->
        <ext:ScriptManager theme="gray">
            <prop:Resources>
                <ext:ScriptFile source="<?php echo Yii::app()->request->baseUrl; ?>/js/application.js"/>
            </prop:Resources>
        </ext:ScriptManager>

        <!--
            Here we extend the App.Chinook for adding
            server-side generated parts
        -->

        <ext:ScriptBlock position="begin">
            <prop:Body>
                <script>
                    Ext.apply(App.Chinook,{

                        createURL:function(controller,action,args)
                        {
                            var type = 0;
                            var templates = Ext.decode('<?php echo $this->createURLTemplates() ?>');
                            if(args)
                                type = args.length-1;

                            type = 'action' + type;
                            var url = templates[type].replace('_controller_',controller).replace('_action_',action);
                            return url;
                        },

                        logout:function()
                        {
                            /**
                             * We mask the application to let the use know we are quitting
                             * the application.
                             */
                            Ext.getBody().mask();
                            location.href="<?php echo $this->createUrl('site/logout') ?>";
                        }
                    })
                </script>
            </prop:Body>
        </ext:ScriptBlock>


        <?php echo $content; ?>
    </body>
</html>